import http from 'utilMethods/http'
import { maxSatisfying } from 'semver'

const request = 'http://report.wsn2019.club/download'

const download = {
  // 下载某群某一段时间内的日报 /download/groupDailyReports
  getDownloadReportOneGroupPeriod (params) {
    return http.get(`${request}/groupDailyReports`,params)
  },
  // 下载某人一段时间的日报 /download/userDailyReport
  getDownloadReportOnePersonPeriod (params) {
    return http.get(`${request}/userDailyReport`,params)
  },
  
  // 发送邮件，附件为某群某一段时间的日报。mailReceiver为收件人邮箱
  // /download/send/groupDailyReports
  getSendGroupReportToMail (params) {
    return http.get(`${request}/send/groupDailyReports` , params)
  },
  // 发送文本邮件 /download/send/simpleMail
  postSendMessageToMail (params) {
    return http.post(`${request}/send/simpleMail`, params)
  },
  // 发送邮件，附件为某人某一段时间的日报。mailReceiver为收件人邮箱 
  // /download/send/userDailyReport
  getSendSinglePersonReportToMail (params) {
    return http.get(`${request}/send/userDailyReport` ,params)
  },
  // 文件的上传  /download/uploadGroupFile
  // 这个接口暂时没有用这种方式
  // postUploadGroupFile (params) {
  //   return http.post(`${request}/uploadGroupFile`, params)
  // },

  // 查询某群群文件，按时间顺序排列 /download/groupFile/{groupId}
  getGroupFileByGroupId (groupId) {
    return http.get(`${request}/groupFile/` + groupId)
  },

  // 删除上传的文件 /download/groupFile/delete/{fileId}
  deleteGroupFile(fileId) {
    return http.delete(`${request}/groupFile/delete/` + fileId)
  },

  
}

export default download
